package Appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type Appconf struct {
	Mysql struct {
		User     string
		Pass     string
		Host     string
		Port     int
		Database string
	}
	Redis struct {
		Host     string
		Port     int
		Database string
	}
}

var Config Appconf

func Init() {
	viper.SetConfigFile("Appconfig/config.yaml")

	viper.ReadInConfig()

	viper.Unmarshal(&Config)

	log.Println(&Config)
}
